package com.lzwk.app.function;


import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.table.annotation.DataTypeHint;
import org.apache.flink.table.annotation.FunctionHint;
import org.apache.flink.table.data.GenericRowData;
import org.apache.flink.table.data.RowData;
import org.apache.flink.table.data.binary.BinaryStringData;
import org.apache.flink.table.functions.ScalarFunction;
import org.apache.flink.table.functions.TableFunction;
import org.apache.flink.table.types.logical.RowType;
import org.apache.flink.types.Row;

import java.util.*;

/**
 * @title: SkinJson
 * @Author Yeaser
 * @Date: 2022/1/5 17:51
 * @Version 1.0
 * Description: TODO
 */
// @FunctionHint(output = @DataTypeHint("row<source_hash_id string>")) 表值函数
public class SkinJson extends ScalarFunction {
    public String eval(String json){
        JSONObject jsonObject = JSON.parseObject(json);
        String source_hash_id = jsonObject.getString("source_id");
       return source_hash_id;
    }
}
